{% extends "../base.html" %}

{% block head %}    
<link rel="stylesheet" type="text/css" href="{{handler.static_url}}/css/forum.css"> 
<script type="text/javascript" src="{{handler.static_url}}/js/forum.js"></script> 

<title>讨论分享 |  Stock+</title> 
{% end %}
{% block body %}  

<div class="container"> 
<div class="forum-filter clearfix">
	<div class="clearfix">
		<ul class="category">  
			<li onclick="categoryClicked(this);" value="0"><a href="/forum">所有</a></li>
			{% for cat in forum['cats'] %}
			{% if cat['id'] == thread['category'] %}
			<li onclick="categoryClicked(this);" class="active" value="{{cat['id']}}"><a href="/forum?cid={{cat['id']}}">{{cat['name']}}</a></li>
			{% else %}
			<li onclick="categoryClicked(this);" value="{{cat['id']}}"><a href="/forum?cid={{cat['id']}}">{{cat['name']}}</a></li>
			{% end %}
			{% end %}
		</ul>   
	</div>  
</div>  
<div class="panel-1"> 

<div class="thread">
	<div class="head">
		<span class="title">{{thread['title']}}</span>
		<div class="author clearfix"> 
			<span class="l"><a href="#">{{thread['user']['name']}}</a> 发布于 {{time_fmt(thread['created_at'])}}</span>
			<span class="r">2个人关注 <a href="#">关注(收藏)</a></span>
		</div> 
	</div> 
	<div class="body">
		<div class="content">
			{{thread['content']}}
		</div> 
	</div>
	<div class="caption">
		<h3>网友评论</h3>
	</div>
	
	<ul class="comment-list"> 
		{% for i in range(2) %}
		{% set num = randrange(10) %}
		<li class="clearfix"> 
			<div class="image32">
				<a href="#"><img src="{{handler.static_url}}/img/{{num}}.jpg"></a>
			</div>
			<div class="text">
				<span class="top">
					<a href="#">洪磊明</a><span>：2011-10-21 14:43 (2小时前)</span>
					<a class="reply" href="#" onclick="showComment('comment-box{{i}}');return false;">回复此评论</a>
				</span>
				<span class="content">又开始了杭州出差的生活， 希望不要失眠。</span> 
				<ul class="comment2-list">
					{% for j in range(randrange(4)) %}
					{% set num = randrange(10) %}
					<li class="clearfix">
						<div class="image24">
							<a href="#"><img src="{{handler.static_url}}/img/{{num}}.jpg"></a>
						</div>
						<div class="content" onmouseover="showReplyLink(this);" onmouseout="hideReplyLink(this);">去了杭州出差， 不失眠才怪
							<span>(13小时前 by <a href="#">洪磊明</a>)</span>
							<a class="hidden" class="reply" href="#" onclick="showComment('comment-box{{i}}','hong');return false;">回复</a>
						</div>
					</li>
					{% end %}
				</ul>
				<div id="comment-box{{i}}" class="comment-box hidden">
					<textarea></textarea>
					<a href="#" class="btn success">回复</a>
					<a href="#" class="btn" onclick="hideComment(this);return false;">关闭</a>
					<span>文明上网，理性发言</span> 
				</div>
			</div> 
		</li>
		{% end %} 
	</ul>  
	<div class="">
		<textarea></textarea>
	</div>
</div>

  
</div> <!-- end of panel-1 -->

<div class="panel-2"> 
{% if 'tags' in thread  and len(thread['tags'])>0 %}
<div class="related-tags">
	<div class="caption">
		<h3>关联标签</h3> 
	</div>   
	<ul class="tags clearfix">
		{% for tag in thread['tags'] %}
		<li><a href="#" class="tag">{{tag}}</a></li> 
		{% end %}
	</ul> 
</div>	
{% end %} 

<div class="clearfix">
	<div class="caption">
		<h3><a href="#">{{thread['user']['name']}}</a> 的其他讨论</h3> 
	</div>  
	<ul class="discussion-list">  
		{% for t in others %}
		<li> 
			<a href="/forum/thread/{{t['_id']}}">{{t['title']}}</a> 
			<span class="stat">(20回复/800阅读，{{time_fmt(t['created_at'])}})</span>
		</li>
		{% end %}
	</ul>   
</div>	 

<div class="clearfix">
	<div class="caption">
		<h3>内容相关讨论</h3> 
	</div>  
	<ul class="discussion-list">  
		{% for i in range(4) %}
		<li> 
			<a href="#">股市大跌三大真正主因剖析</a> 
			<span class="stat">(20回复/800阅读，3天前)</span>
		</li>
		{% end %}
	</ul>  
	  
</div>	 
		
</div>  <!-- end of panel-2 --> 

</div> 
{% end %}
